package com.nju.bean.dbc;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Calendar;

import com.nju.bean.cloud.Dot;
import com.nju.bean.newsbang.data.Fragment;
import com.nju.bean.newsbang.data.Lable;
import com.nju.bean.newsbang.data.Reply;
import com.nju.bean.newsbang.data.TittleList;
import com.nju.bean.newsbang.data.Topic;
import com.nju.bean.newsbang.data.User;

public class DbTest {
	public static void main(String args[]){
		DataBaseManager db = DataBaseManager.getInstance();
		
		try {
			DatabaseInitializer.clearAll();
			System.out.println(db.getMaxTopicId());
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		/*
		//topic
		Topic t = new Topic("String tittle");
		t.setId("testtest");

		Fragment f1 = new Fragment("Name1", "text1", false,0, 0);
		f1.setTopicId("testtest");
		f1.setId("Fragment1");
		Fragment f2 = new Fragment("Name2", "text2", true, 0, 0);
		f2.setTopicId("testtest");
		f2.setId("Fragment2");
		
		Reply r1 = new Reply("String id1", "String au1","String c1",Calendar.getInstance(),"testtest");
		Reply r2 = new Reply("String id2", "String au2","String c2",Calendar.getInstance(),"testtest");
		
		User u = new User("String NAME","String token","String secret");
		try {
			db.addNewTopic(t);
			db.addNewFragmentToTopic(f1, "testtest");
			db.addNewFragmentToTopic(f2, "testtest");
			db.addNewReplyToTopic(r1, "testtest");
			db.addNewReplyToTopic(r2, "testtest");
			
			db.addUser(u);
			db.addPoint("String NAME", 89);
			db.addPoint("String NAME",-30);
			
			System.out.println(db.getPoint("String NAME"));
			
			u = db.getUser("String NAME");
			
			System.out.println(u.getSecret());
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		*/
	}
}
